// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import goods from 'components/goods/goods'
import ratings from 'components/ratings/ratings'
import seller from 'components/seller/seller'
import 'common/stylus/index.styl'
Vue.use(VueRouter)
Vue.use(VueResource)
Vue.config.productionTip = false
//定义路由
const routes = [
  {path:'/goods', component:goods},
  {path:'/ratings', component:ratings},
  {path:'/seller', component:seller}
]

//创建router实例
const router = new VueRouter({
  linkActiveClass: 'active',
  routes
});

//创建和挂载根节点
const app = new Vue({
  router,
  template: '<App/>',
  components: { App }
}).$mount('#app')

// 相当于vue1.0 的router.go方法
router.push('./goods')
